//@ sourceURL=AccidentInjuryView.js
Ext.ns("AccidentInjuryView");
AccidentInjuryView = Ext.extend(Ext.Panel, {
    constructor : function(a) {
        Ext.applyIf(this, a);
        var all=this.initUIComponents();
        AccidentInjuryView.superclass.constructor.call(this, {
            id : "AccidentInjuryView",
            title : "事故工伤管理",
            region : "center",
            layout : "border",
            border : false,
            iconCls : "menu-position",
            items : [all.yearGridPanel,all.yearGridSearchPanel,all.yearGridTreePanel]
        });
    },
    initUIComponents : function() {
        var yearGridComponents=new createyeargridview({
            topbar : {
                inputFormName : 'AccidentInjuryForm',
                topbarAdd:{
                    hidden:false
                },
                topbarDel:{
                    hidden:false
                }
            },
            search : {
                items : [ {
                    style : "margin:5px 5px 5px 5px;",
                    text : "事故名称"
                }, {
                    columnWidth : 0.2,
                    xtype : "textfield",
                    name : "Q_accidentName_S_LK",
                    maxLength : 256
                } ]
            },
            grid : {
                title : "事故工伤列表",
                rowActions:true,
                listUrl : __ctxPath + "/health/listAccidentInjury.do",
                removeUrl : __ctxPath + "/health/deleteAccidentInjury.do",
                fields : [ "id", 'years', 'accidentName','accidentGrade', "personName", "department","laborAppraisal","managers","accidentDate","handleDate","certificateNo","injuredAfter","personLiable","opinion"],
                columns : [ {
                    header : "id",
                    dataIndex : "id",
                    hidden : true
                }, {
                    header : "年份",
                    dataIndex : "years",
                    hidden : true,
                    sortable : true
                },{
                    header : "事故名称",
                    dataIndex : "accidentName",
                    width : 70
                },{
                    header : "事故等级",
                    dataIndex : "accidentGrade",
                    width : 80,
                    renderer : function(j,i,g,m,h){
                        if(j==1){
                            return "特别重大事故";
                        }else if(j==2){
                            return "重大事故";
                        }else if(j==3){
                            return "较大事故";
                        }else if(j==4){
                            return "一般事故";
                        }
                    }
                },{
                    header : "员工名称",
                    dataIndex : "personName",
                    width : 70
                },{
                    header : "所在部门",
                    dataIndex : "department",
                    width : 70
                },{
                    header : "劳动鉴定",
                    dataIndex : "laborAppraisal",
                    width : 70
                },{
                    header : "事故时间",
                    dataIndex : "accidentDate",
                    width : 70
                }
            ]
            },
            tree : {
                treeUrl : __ctxPath + "/health/treeLoadAccidentInjury.do"
            }
            
        });
        return yearGridComponents;
    }
});


